<template>
    <view class="user-info  px-[50rpx]  py-[50rpx]" style="position: relative;">
		<image style="width: 100%; position: absolute; top: 0; left: 0; z-index: -1;" src="https://shengyue.yaoyunxin.cn/uploads/images/20240127/20240127105424cb7208522.png" mode="widthFix"></image>
        <view
            v-if="isLogin"
            class="flex items-center toux"
            @click="navigateTo('/pages/user_data/user_data')"
        >
            <u-avatar :src="user.avatar" :size="120"></u-avatar>
            <view class="text-white1 ml-[20rpx] kuan">
                <view class="text-white1">{{ user.nickname }}</view>
				<!-- <view class="text-2xl">{{ user.nickname }}</view> -->
               <!-- <view class="text-xs mt-[18rpx]" @click.stop="copy(user.account)">
                    账号：{{ user.account }}
                </view> -->
				<view class="renzheng" v-if="user.qualifications=='0'" @click="gotoRen">
					未认证
				</view>
				<view class="renzheng" v-if="user.qualifications=='1'">
					已认证
				</view>
            </view>
        </view>
		<!-- <view class="caig"  v-if="isLogin"> -->
		<view class="caig"  v-if="isLogin">
			<view class="" @click="gotogong">
				<view class="caig-top">
					{{user.gongyin}}
				</view>
				<view class="caig-bottom">
					供应信息
				</view>
			</view>
			<view class="" @click="gotocai">
				<view class="caig-top">
					{{user.caigounum}}
				</view>
				<view class="caig-bottom">
					采购信息
				</view>
			</view>
		</view>
        <navigator v-else class="flex items-center toux" hover-class="none" url="/pages/login/login">
            <u-avatar src="/static/images/user/default_avatar.png" :size="120"></u-avatar>
            <view class="text-white1 text-3xl ml-[20rpx]">未登录</view>
        </navigator>
		
     <!--   <navigator v-if="isLogin" hover-class="none" url="/pages/user_set/user_set">
            <u-icon name="setting" color="#fff" :size="48"></u-icon>
        </navigator> -->
    </view>
</template>
<script lang="ts" setup>
import { useCopy } from '@/hooks/useCopy'

const props = defineProps({
    content: {
        type: Object,
        default: () => ({})
    },
    styles: {
        type: Object,
        default: () => ({})
    },
    user: {
        type: Object,
        default: () => ({})
    },
    isLogin: {
        type: Boolean
    }
})
const { copy } = useCopy()
const navigateTo = (url: string) => {
    uni.navigateTo({
        url
    })
}

const gotoRen=()=>{
	uni.navigateTo({
		url:"/pages/user_data/user_data"
	})
}
const gotogong=()=>{
	uni.navigateTo({
		url:"/pages/user/supply"
	})
}
const gotocai=()=>{
	uni.navigateTo({
		url:"/pages/user/procure"
	})
}
</script>

<style lang="scss" scoped>
.user-info {
    // background: url(../../../static/images/user/my_topbg.png);
	// background: url(../../../static/images/index/bg.png);
    // height: 230rpx;
	height: 400rpx;
    background-position: bottom;
    background-size: 100% auto;
}
.text-white1{
	font-size: 36rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 600;
	color: #333333;
}
.caig{
	display: flex;
	justify-content: space-evenly;
	text-align: center;
	margin-top: 28rpx;
	.caig-top{
		font-size: 36rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #000000;
		margin-bottom: 7rpx;
	}
	.caig-bottom{
		font-size: 24rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #777777;
	}
}
.toux{
	margin-top: 10rpx;
}

// .subscribe{
// 	text-align: right;
// 	// width: 100%;
// 	flex: 1;
// 	// padding: 5rpx 10rpx;
// 	color: #fff;
// 	.subscribe-item{
// 		// padding: 5rpx 10rpx;
// 		text-align: center;
// 		 margin-left: auto;
// 		width: 150rpx;
// 		height: 50rpx;
// 		line-height: 50rpx;
// 		border-radius: 10rpx;
// 		background-color: #59c381;
// 	}
// }
.renzheng{
	    background: #00bb78;
	    color: #fff;
	    font-size: 29rpx;
	    padding: 5rpx 20rpx;
	    border-radius: 10rpx;
}

</style>
